import axios from "axios";
import { ElMessage } from "element-plus";

export const myUploadFile = (file: any, url: string, key: string, msg: string) => {
    const formData = new FormData();
    formData.append(key, file);
    axios.post(url, formData).then((res:any) => {
        console.log(res)
        // 上传成功后的处理
        ElMessage.success(msg)
    })
}

// 实例
//myUploadFile(file, `${state.baseUrl}/v0/system/about/license`, 'file', '上传成功，请刷新页面')